package org.example.price.controller;


import org.example.feign.feignClient.PojoServiceClient;
import org.example.feign.pojo.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@CrossOrigin("*")
@RestController
public class priceController {

    private final PojoServiceClient pojoServiceClient;

    public  priceController( PojoServiceClient pojoServiceClient) {
        this.pojoServiceClient = pojoServiceClient;

    }
    @GetMapping("/price")
    public Result getprice() throws IOException {
        System.out.println(pojoServiceClient.getprice());
        Result price =pojoServiceClient.getprice();
        System.out.println(price);
        return price;
    }
}